package com.bfly.mall.shop.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bfly.core.config.ResourceConfigure;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * 门店图片
 *
 * @author 长沙商脉科技有限公司
 * @date 2020/12/10 17:36
 */
@TableName(value = "shop_pic", resultMap = "ShopPicResultMap")
public class ShopPic implements Serializable {
    private static final long serialVersionUID = -7040094752583649473L;

    /**
     * 门店ID
     *
     * @author 长沙商脉科技有限公司
     * @date 2020/12/10 17:37
     */
    @TableField("shop_id")
    private int shopId;

    /**
     * 排序
     *
     * @author 长沙商脉科技有限公司
     * @date 2020/12/10 17:38
     */
    @TableField("seq")
    private int seq;

    /**
     * 图片地址
     *
     * @author 长沙商脉科技有限公司
     * @date 2020/12/10 17:38
     */
    @TableField("original_img")
    private String originalImg;

    public String getUrl() {
        return StringUtils.isNotBlank(getOriginalImg()) ? ResourceConfigure.getResourceHttpUrl(getOriginalImg()) : "";
    }

    public int getShopId() {
        return shopId;
    }

    public void setShopId(int shopId) {
        this.shopId = shopId;
    }

    public int getSeq() {
        return seq;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public String getOriginalImg() {
        return originalImg;
    }

    public void setOriginalImg(String originalImg) {
        this.originalImg = originalImg;
    }
}
